function scheduleHtmlParser(data) {
// data 转json
data = JSON.parse(data);

// 声明函数
function parseWeeks(weekRange){
    const match = weekRange.match(/(\d+)-(\d+)/); // 使用正则表达式匹配字符串
    const match2 = weekRange.match(/(\d+)/); // 使用正则表达式匹配字符串
    const oddOrEven = weekRange.match(/(单|双)/); // 使用正则表达式匹配字符串

    if (match) {
        const start = parseInt(match[1], 10);
        const end = parseInt(match[2], 10);
        if (oddOrEven) {
            const weeks = [];
            if (oddOrEven[1] === "单") {
                for (let i = start; i <= end; i++) {
                    if (i % 2 === 1) {
                        weeks.push(i);
                    }
                }
            } else {
                for (let i = start; i <= end; i++) {
                    if (i % 2 === 0) {
                        weeks.push(i);
                    }
                }
            }
            return weeks;
        } else {
            const weeks = Array.from({ length: end - start + 1 }, (_, index) => start + index);
            return weeks;
        }
    } else if (match2) {
        const weeks = [parseInt(match2[1], 10)]
        return weeks;
    } else {
        console.log("Invalid week range format. Please use the format 'x-y'.");
        return [];
    }
}
//解析节次
const parseSections = parseWeeks
// 正式开始解析
result = [];
for (let i of data["kbList"]) {
    let temp = {};
    temp["name"] = i["kcmc"];
    temp["position"] = i["cdmc"];
    temp["teacher"] = i["xm"];
    temp["weeks"] = parseWeeks(i["zcd"]);
    temp["day"] = i["xqj"];
    temp["sections"] = parseSections(i["jc"]);
    result.push(temp);
}
return result;
}